package com.hxkj.controller.taglib;

import com.alibaba.fastjson.JSONObject;
import com.hxkj.domain.po.FreeMarker;
import com.hxkj.domain.po.VisualBean;
import com.hxkj.service.taglib.AnakyzeFreeMakerShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * @ClassName AnakyzeFreeMakerShowController 可视化解析调用
 * @Description TODO
 * @Author Mr.zheng
 * @Date 2018/8/16 14:24
 * @Version 1.0
 */
@RestController
@RequestMapping("/anakyzeShow")
public class AnakyzeFreeMakerShowController {
    @Autowired
    private AnakyzeFreeMakerShowService anakyzeFreeMakerShowService;

    /**
    * @Description anakyzeFreeMakerShow 可视化模板解析调用接口
    **/
    @RequestMapping(value = "/anakyzeFreeMakerShow")
    public Callable<JSONObject> anakyzeFreeMakerShow(@ModelAttribute FreeMarker freeMarker) throws Exception{
        return () ->  anakyzeFreeMakerShowService.anakyzeFreeMakerShow(freeMarker);
    }


    /**
     * @Description modifyMd5 修改模板文件及其资源文件的MD5值
     **/
    @RequestMapping(value = "/modifyMd5")
    public void modifyMd5(@ModelAttribute VisualBean visualBean) throws Exception{
        anakyzeFreeMakerShowService.modifyMd5(visualBean);
    }
}
